﻿'use strict';

// the storeController contains two objects:
// - store: contains the product list
// - cart: the shopping cart object
function storeController($scope, $routeParams, DataService) {

    // get store and cart from service
    $scope.store = DataService.store;
    $scope.cart = DataService.cart;
    $scope.selected = undefined;
    // use routing to pick the selected product
    if ($routeParams.productSku != null) {
        $scope.product = $scope.store.getProduct($routeParams.productSku);
    }
    $scope.pmgAddToCar = function() {
        console.log("agrengando al carrito " + $scope.selected + " packs:" + $scope.packs + " unidades:"+$scope.unidades);
        console.log($scope.match);
        
        
    }
    
    $scope.hizoEnter= function($event) {
        $event.preventDefault();
        console.log("hizo enter re loco");

    }
    
     
}
